package com.timous.dao;


import com.timous.Entity.Type;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface TypeRepository extends JpaRepository<Type, Long> {


    Type findByName(String name);

    //分页的大小作为分页的顺序
    @Query("select t from Type t")
    List<Type> findTop(Pageable pageable);


}
